package com.leesche.zcsp.node.app.v1.vo;

import com.leesche.zcsp.node.utils.calculator.Calculation;

import java.math.BigDecimal;

/**
 * @author Jerry Chan
 * @version V1.0
 *          ************ * Jerry Chan: * 2016/11/25 15:09: * 创建该类并实现业务逻辑: *********
 * @Title: AccountSummary.java
 * @Description: TODO(APP->账目汇总信息)
 * @date 2016/11/25 15:09
 */
public class AccountSummary {

    private Long deviceid;
    private String createDate;
    //金额统计
    private String grossIncome;//总收入
    private String moneyIncome;//现金加硬币的收入
    private String cashIncome;//纸币的收入
    private String iconIncome;//一元硬币的收入
    private String netpayIncome;//网络支付的收入
    //第三方支付统计
    private String wechatpayIncome;//微信支付
    private String alipayIncome;//支付宝支付
    //现金数量
    private long oneBalance = 0;//一元纸币
    private long fiveBalance = 0;//五元纸币
    private long tenBalance = 0;//十元纸币
    private long twentyBalance = 0;//二十元纸币
    private long fifyBalance = 0;//五十元纸币
    private long hundredBalance = 0;//一百元纸币
    //非金钱收益统计
    private Integer remotelyOutGameCoinQuantity = 0; //远程补币数量
    private Long gameCoinQuantity = 0L; //游戏币数量
    private Long giftSellQuantity = 0L;      //出礼品数量
    private Long outGameCoinQuantity = 0L;   //出游戏币数量
    private Integer giftstockQuantity = 0;  //礼品库存

    public AccountSummary() {
    }

    public AccountSummary(Long deviceid) {
        this.deviceid = deviceid;
    }

    public AccountSummary(Long deviceid, String createDate) {
        this.deviceid = deviceid;
        this.createDate = createDate;
    }

    /**
     * @param billbalance   纸币收入
     * @param iocnBalance   一元硬币
     * @param wecahtBalance 微信支付
     * @param alipayBalance 支付宝支付
     * @return null
     * @throws null
     * @Title: inventoryIncome()
     * @Description: TODO(统计现金及第三方支付的收益)
     * @author Jerry Chan
     * @date 2016/11/25 15:47
     */
    public void inventoryIncome(long billbalance, long iocnBalance, long wecahtBalance, long alipayBalance) {

        //纸币收入
        this.cashIncome = Calculation.addition(billbalance);

        //硬币收入
        this.iconIncome = Calculation.addition(iocnBalance);

        //纸币加硬币收入
        long money = billbalance + iocnBalance;
        this.moneyIncome = Calculation.addition(money);

        //微信支付收入
        BigDecimal wechat = Calculation.divide(wecahtBalance);
        this.wechatpayIncome = Calculation.addition(wechat);
        //支付宝支付收入
        BigDecimal alipay = Calculation.divide(alipayBalance);
        this.alipayIncome = Calculation.addition(alipay);

        //网络支付收入
        BigDecimal wechatAndAlipayIncoime = wechat.add(alipay);
        this.netpayIncome = Calculation.addition(wechatAndAlipayIncoime);

        //总收入
        this.grossIncome = Calculation.addition(wechatAndAlipayIncoime.add(new BigDecimal(money)));
    }

    /**
     * @param oneBalance     一元纸币
     * @param fiveBalance    五元纸币
     * @param tenBalance     十元纸币
     * @param twentyBalance  二十元纸币
     * @param fifyBalance    五十元纸币
     * @param hundredBalance 一百元纸币
     * @return
     * @Title: inventoryCashQuantity
     * @Description: TODO(统计各面值纸币的数量)
     * @author Jerry Chan
     * @date 2016/11/25 18:04
     */
    public void inventoryCashQuantity(long oneBalance, long fiveBalance, long tenBalance, long twentyBalance, long fifyBalance, long hundredBalance) {
        this.oneBalance = oneBalance;
        this.fiveBalance = fiveBalance;
        this.tenBalance = tenBalance;
        this.twentyBalance = twentyBalance;
        this.fifyBalance = fifyBalance;
        this.hundredBalance = hundredBalance;
    }


    /**
     * @param remotelyOutGameCoinQuantity 远程补币数量
     * @param gameCoinQuantity            游戏币数量
     * @param giftSellQuantity            出礼品数量
     * @param outGameCoinQuantity         出游戏币数量
     * @param giftstockQuantity           礼品库存数量
     * @return null
     * @Title: inventory()
     * @Description: TODO(盘点非金额收入)
     * @author Jerry Chan
     * @date 2016/11/25 17:19
     */
    public void inventoryNotIncome(Integer remotelyOutGameCoinQuantity, Long gameCoinQuantity, Long giftSellQuantity, Long outGameCoinQuantity, Integer giftstockQuantity) {
        this.remotelyOutGameCoinQuantity = remotelyOutGameCoinQuantity;
        this.gameCoinQuantity = gameCoinQuantity;
        this.giftSellQuantity = giftSellQuantity;
        this.outGameCoinQuantity = outGameCoinQuantity;
        this.giftstockQuantity = giftstockQuantity;
    }

    /**
     * @Title: toZero
     * @Description: TODO(账目归零)
     * @author Jerry
     * @date 2016-11-02 08:44:50
     */
    public void toZero() {
        String zero = "0.00";
        this.grossIncome = zero;//总收入
        this.cashIncome = zero;
        this.iconIncome = zero;
        this.moneyIncome = zero;
        this.wechatpayIncome = zero;
        this.alipayIncome = zero;
        this.netpayIncome = zero;
        this.oneBalance = 0;
        this.fiveBalance = 0;
        this.tenBalance = 0;
        this.twentyBalance = 0;
        this.fifyBalance = 0;
        this.hundredBalance = 0;
        this.remotelyOutGameCoinQuantity = 0;
        this.gameCoinQuantity = 0L;
        this.giftSellQuantity = 0L;
        this.outGameCoinQuantity = 0L;
        this.giftstockQuantity = 0;
    }


    public Long getDeviceid() {
        return deviceid;
    }

    public void setDeviceid(Long deviceid) {
        this.deviceid = deviceid;
    }

    public String getCreateDate() {
        return createDate;
    }

    public void setCreateDate(String createDate) {
        this.createDate = createDate;
    }

    public String getGrossIncome() {
        return grossIncome;
    }

    public void setGrossIncome(String grossIncome) {
        this.grossIncome = grossIncome;
    }

    public String getMoneyIncome() {
        return moneyIncome;
    }

    public void setMoneyIncome(String moneyIncome) {
        this.moneyIncome = moneyIncome;
    }

    public String getCashIncome() {
        return cashIncome;
    }

    public void setCashIncome(String cashIncome) {
        this.cashIncome = cashIncome;
    }

    public String getIconIncome() {
        return iconIncome;
    }

    public void setIconIncome(String iconIncome) {
        this.iconIncome = iconIncome;
    }

    public String getNetpayIncome() {
        return netpayIncome;
    }

    public void setNetpayIncome(String netpayIncome) {
        this.netpayIncome = netpayIncome;
    }

    public String getWechatpayIncome() {
        return wechatpayIncome;
    }

    public void setWechatpayIncome(String wechatpayIncome) {
        this.wechatpayIncome = wechatpayIncome;
    }

    public String getAlipayIncome() {
        return alipayIncome;
    }

    public void setAlipayIncome(String alipayIncome) {
        this.alipayIncome = alipayIncome;
    }

    public long getOneBalance() {
        return oneBalance;
    }

    public void setOneBalance(long oneBalance) {
        this.oneBalance = oneBalance;
    }

    public long getFiveBalance() {
        return fiveBalance;
    }

    public void setFiveBalance(long fiveBalance) {
        this.fiveBalance = fiveBalance;
    }

    public long getTenBalance() {
        return tenBalance;
    }

    public void setTenBalance(long tenBalance) {
        this.tenBalance = tenBalance;
    }

    public long getTwentyBalance() {
        return twentyBalance;
    }

    public void setTwentyBalance(long twentyBalance) {
        this.twentyBalance = twentyBalance;
    }

    public long getFifyBalance() {
        return fifyBalance;
    }

    public void setFifyBalance(long fifyBalance) {
        this.fifyBalance = fifyBalance;
    }

    public long getHundredBalance() {
        return hundredBalance;
    }

    public void setHundredBalance(long hundredBalance) {
        this.hundredBalance = hundredBalance;
    }

    public Integer getRemotelyOutGameCoinQuantity() {
        return remotelyOutGameCoinQuantity;
    }

    public void setRemotelyOutGameCoinQuantity(Integer remotelyOutGameCoinQuantity) {
        this.remotelyOutGameCoinQuantity = remotelyOutGameCoinQuantity;
    }

    public Long getGameCoinQuantity() {
        return gameCoinQuantity;
    }

    public void setGameCoinQuantity(Long gameCoinQuantity) {
        this.gameCoinQuantity = gameCoinQuantity;
    }

    public Long getGiftSellQuantity() {
        return giftSellQuantity;
    }

    public void setGiftSellQuantity(Long giftSellQuantity) {
        this.giftSellQuantity = giftSellQuantity;
    }

    public Long getOutGameCoinQuantity() {
        return outGameCoinQuantity;
    }

    public void setOutGameCoinQuantity(Long outGameCoinQuantity) {
        this.outGameCoinQuantity = outGameCoinQuantity;
    }

    public Integer getGiftstockQuantity() {
        return giftstockQuantity;
    }

    public void setGiftstockQuantity(Integer giftstockQuantity) {
        this.giftstockQuantity = giftstockQuantity;
    }
}
